<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<button-counter></button-counter>
			<!-- 組件的复用 -->
			<button-counter></button-counter>
			<button-counter></button-counter>
		</div>
		<script type="text/javascript">
			Vue.component('button-counter', {
				data: function() {
					return {
						count: 0
					}
				},
				template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>'
			});
			var vm = new Vue({
				el: '#app'
			});
		</script>
	</body>
</html>
